package com.hangwei.paperless.widget;

import android.app.Activity;
import android.app.Dialog;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.LinearLayout;

import com.hangwei.paperless.R;

public abstract class CardSealPop extends Dialog {

    private Activity mActivity;
    private boolean needAlpha = true;

    public CardSealPop(Activity context, boolean shadow) {
        this(context);
        needAlpha = false;
    }

    public CardSealPop(Activity context) {
        super(context, com.twelve.all.R.style.generic_dialog);
        mActivity = context;
        View inflate = LayoutInflater.from(context).inflate(R.layout.pop_seal_by_card, null);
        setCancelable(true);// 不可以用“返回键”取消
        setCanceledOnTouchOutside(false);
        // 设置popWindow的显示和消失动画
//        setAnimationStyle(R.style.mypopwindow_anim_style);


        setContentView(inflate, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.MATCH_PARENT));
        //popWindow消失监听方法
    }

    @Override
    public void dismiss() {
        onDismiss1();
        super.dismiss();
    }

    protected abstract void onDismiss1();

}
